package com.ds.infrastructure.hyperspace.console.model.request.container;

import com.ds.infrastructure.hyperspace.console.entity.enums.TbPublicEnum;
import com.ds.infrastructure.hyperspace.console.entity.table.TbReleaseTask;
import com.ds.infrastructure.hyperspace.console.model.request.form.PageForm;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;

/**
 * @author: yaozhendong
 * @create: 2019-11-12 09:30
 **/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class GetReleaseTaskListForm extends PageForm {

    @NotNull
    private Long stageId;

    public static TbReleaseTask toEntity(GetReleaseTaskListForm form) {
        TbReleaseTask tbReleaseTask = new TbReleaseTask();
        tbReleaseTask.setStageId(form.getStageId());
        tbReleaseTask.setCompleteState(TbPublicEnum.TASK_COMPLETE_STATE.COMPLETE.value);
        tbReleaseTask.setGmtIsDeleted(TbPublicEnum.GMD_IS_DEL.NO.code);
        return tbReleaseTask;
    }
}
